const axios = require('axios')

refreshToken()

async function refreshToken() {
  const requestConfig = {
    url: `http://www.weixiaotong.com.cn/api/pc/base_cosclient_getCosToken`,
    data: {
      params: {
        requestUrl:
          'http://www.weixiaotong.com.cn/weixt/portal/#/main/microportal/newsedit/1001/0/0/130?title=',
        bucket: 'weixt-static-1305346148',
        isEncrypt: true,
        token: '2056409ead6bfc2b787c5a470dd7e9bf',
      },
    },
    method: 'POST',
    headers: { 'Content-Type': 'application/json; charset=UTF-8' },
    interceptors: {
      response: (res) => {
        return res.data.data
      },
    },
  }

  const res = await axios(requestConfig).catch((e) => {
    console.log(e)
  })
  console.log(res)
}
